
import Qt 4.7


Rectangle {
    id: window
    color: "#3E606F"

    XmlListModel {
	property string searchMotif: "teeyah"  
	id: xmlYoutubeModel
	source: "http://gdata.youtube.com/feeds/api/videos?q="+searchMotif+"&max-results=10&start-index=1"
	query: "//entry"
	XmlRole { name: "name"; query: "media:group/media:title/string()" }
	XmlRole { name: "icone"; query: "media:group/media:thumbnail[1]/@url/string()" }
    }

    
    ListView {
	    id: list1
	    y: 10 
	    width: 300
	    height: 800
	    //height : parent.height
	    focus: true
            model:xmlYoutubeModel
	    anchors.fill: parent
	    delegate: ListViewDelegate {}
	    orientation : ListView.Horizontal
	    //spacing:20
	    /*Behavior on y {
		NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
	    }*/
	    
	    /*Keys.onPressed: {
		if (event.key == Qt.Key_Return) {
		    console.log("selected ############:"  + currentIndex );
		    event.accepted = true;
		}
	    }*/
	}

	/*states: 
		State {
			  name: "avancer";
			  PropertyChanges { target: list1; x:1000  }
		      }
	    
	    transitions: Transition {
		NumberAnimation { properties: "x,y"; duration: 2000 }
	    }*/
        
   
        
}
